GPRS (General Packet Radio Service)

See also: Networking and Communications

 

Topic Menu

 

GPRS Overview

Home > Program > GPRS > GPRS Configuration

 

 

GPRS network can be used to establish communication between OCS and any other communicating devices having unique IP address and port configuration.

 

GPRS can be used to establish connectivity with:

  • Remote server for exchanging register data.

  • Cscape for downloading / uploading and debugging the application using redirector software.

  • GSM network for sending / receiving configured SMS messages.

  • It can be used for peer to peer communication.

  • GPRS service must be enabled in SIM.

  • Static SIM with VPN functionality is required.

  • Auto dial blocks of modem are required on both server and client.

 

Return to the Top: GPRS (General Packet Radio Service)

 

GPRS Configuration

Horner OCS firmware is designed to initialize GSM modem to establish GPRS connectivity. This configuration needs to be done for connectivity with remote server as well as for connectivity with Cscape.

  1. Open the GPRS Configuration by selecting Program > Messaging > GPRS from the Home Menu.

  2. Select Enable GPRS Configuration check box.

  3. Configure GPRS as per the information obtained by the Network Service Provider.

 

The following dialog will appear:

GPRS Access Point Configuration:

The GPRS Access Point Configuration is mandatory and the fields are to be filled according to the information obtained by the Network Service Provider.

 

GPRS Packet Assembler/Disassembler Configuration Configuration:

 

Additional ladder program must be written to establish connection with remote server/client over GPRS service. On the device, change the default programming port to GSM from the system menu, serial port option.

 

i.e. OCS ’System Menu > Set Serial Ports > Dflt Pgm Port >GSM’ for MJ1.

Select default programming port as GPRS in OCS system menu option (Shown above).

 

Return to the Top: GPRS (General Packet Radio Service)

 

GPRS Communication Blocks

Open Port

For peer to peer communication over GSM/GPRS, communication blocks are required to be configured as follows: Project Toolbox > Serial Operations > Open Serial Port. Follow the above steps will create an Open Port, also called a Function Block. Drag it to the grid.

Double click function block, and the following dialog box appears:

In case of internal GSM modem, the mode should be specified GSM Quad. Follow the configuration shown above. The protocol can be selected from the drop down as CsCAN, Generic or Modbus. For Modbus, Slave or Master block should be used.

 

Return to the Top: GPRS (General Packet Radio Service)

 

Modem Control Block

NOTE: To use modem control block, the comm port must be opened first using Open Port block.

 

Auto Dial Modem Option for GPRS

Modem Control block with ’Auto Dial’ option is used to connect to remote server/client using GPRS service.

IP AddressClosed IP Address - Internet Protocol - This is the address of a device on an Ethernet or Wi-Fi network. Horner controllers currently use IPv4 standards with addresses consisting of 4 numbers, or octets, separated by decimal points. and Port number needs to be entered in edit box for ‘Number (IP / Port Address)’. A register reference can also be provided here. If register reference is used, the IP and port details need to be provided at the mentioned register location.

 

Support for IP and Port address entry in Binary format and automatic detection of Client or server mode based upon IP/Port address entry.

 

EXAMPLE

If register reference %R100 is entered for IP/Port address.

Contents of %R100 in String Format:

Client Mode: %R100 = “10.111.64.2/10001” (Register %R100 to %R108 are used)

Server Mode: %R100 = “192.168.5.2” (Register %R100 to %R105 are used)

 

Contents of %R100 in Binary Format:

Client Mode:

%R100 = “IPBN”

%R102 = 10.111.64.2 (IP address in Binary Format)

%R104 = 10001 (Port address in Binary Format)

(Register R100 to R104 are used)

Server Mode:

%R100 = “IPBN”

%R102 = 192.168.5.2 (IP address in Binary Format)

%R104 = 0 (Zero, to indicate no Port Address)

(Register R100 to R104 are used)

Select type of protocol UDPClosed UDP - User Datagram Protocol - An alternative communications protocol to Transmission Control Protocol (TCP) used primarily for establishing low-latency and loss-tolerating connections between applications on the internet. or TCPClosed TCP - Transmission Control Protocol - A standard that defines how to establish and maintain a network conversation through which application programs can exchange data. over IP.

 

Configure the status register to show the status of the connection. The [status values] are mentioned below.

If modem ladder block input is enabled, then modem tries to establish connection with remote server in client mode or waits for connection request from client in server mode.

 

Project Toolbox > Serial Operations > Serial Modem Control

 

Double click on the function block, and the following dialog box appears:

 

 

Auto Answer Modem Option

Modem Control block with ’Auto Answer’ option is used for receiving connection request from remote server or device. Number of rings after which connection request is to be accepted is entered in text box provided. Configure the status register to show the status of the connection. See Modem Status Register Value Definitions

 

 

Initialize Modem Option

Modem Control block with ’Initialize Modem’ option is used for execution of modem specific AT commands. Modem specific AT command to be executed is to be entered in ’Init String’ text box provided in control. If AT command execution is successful, then Modem Control block output is enabled else the output is disabled. The status register is updated depending upon the response from modem. The response from modem is stored in consecutive register locations starting from ’status register+1’ address.

 

Example: Modem control block with ’Initialize Modem’ option is used to get balance left from service provider. The service provider balance request string is entered in ’Init String’ box together with CUSD AT command. As shown below in screen shot. The response from service provider is stored in consecutive register locations starting from ’Status Address + 1’.

 

NOTE: The command to be sent for balance enquiry is: +CUSD = 1,”*111#”,15 where ”*111#” is string to request left balance in SIM and may vary depending on the service provider.

 

Return to the Top: GPRS (General Packet Radio Service)

 

Modem Status Register Value Definitions

Modem Status Register Value Modem Output Power
Modem is inactive 65535 (0xFFFF) Disabled
Modem command started and waiting for response 65534 (0xFFFF) Disabled
Modem is not responding (Command Timeout) 65533 (0xFFFD) Disabled
Modem Command succeeded 0 (0x0)

Enabled (Only in case of Initialization

modem command else Disabled)

Modem is connected to destination server 1 (0x1) Enabled
Modem is Ringing (i.e. incoming call) 2 (0x2) Disabled
Modem detected no/lost carrier 3 (0x3) Disabled
Modem command syntax error 4 (0x4) Disabled
SMS functionality is Active 5 (0x5) Disabled
Modem in Listen (Server) Mode 6 (0x6) Disabled
Email functionality is Active 7 (0x7) Disabled

NOTE: At any given time, the modem can service only one of the modes i.e. connectivity with Cscape, data exchange or SMS.

 

  • SMS transmission and reception (whenever enabled) will be slow when modem is active.

  • Status of ’6’ indicates mode is waiting for connection request from specified client and it is applicable in case of GPRS server mode.

  • When modem returns status ’Connected’, then TX, RX or other communication ladder block can be used to exchange data with destination server according to protocol.

  • Disabling Modem Control ladder block input will disconnect GPRS service. Status register value changes to 65534 (0xFFFE i.e. indicates waiting for modem response for disconnect command) and then to 65535 (0xFFFF).

  • SMS functionality will work based upon Data Transmission SettingsSMS Communications window while GSM/GPRS connection is active.

  • Connecting to GPRS network and establishing connection with remote server might take around 3-4minutes.

  • Disconnecting connection with remote server might take 10-20 seconds.

  • If continuous error response is seen in status register or 0xFFFE response is seen while connecting to the modem as default programming port, then check:

    • SIM card is properly inserted in the modem.

    • SIM is enabled for given service (i.e. GPRS or GSM data call).

    • Antenna is connected properly.

    • GPRS configuration parameters in case of GPRS connection.

    • GSM Signal strength at given place.

    • Check VPN connectivity.

  • If Default programming port is switched to default serial port option (MJ1) from GSM/GPRS then port might get released after 20-30 sec (i.e. after complete GSM/GPRS connection drop).

 

Return to the Top: GPRS (General Packet Radio Service)